package manager.dao.impl;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.session.SqlSession;

import manager.dao.FriendDAO;
import manager.vo.Friend;

public class FriendDAOImpl implements FriendDAO{
	private FriendDAO friendDAO = null;
	public FriendDAOImpl(SqlSession session) throws Exception{
		this.friendDAO = session.getMapper(FriendDAO.class);
	}
   //查询朋友
   public List<Friend> selectFriend(Map<String,Object>map) throws Exception{
	   List<Friend> list = this.friendDAO.selectFriend(map);
	   return list;
   }
   //添加
   public int addFriend(Friend friend) throws Exception{
	  int count = this.friendDAO.addFriend(friend);
	  return count;
   }
   //查询条数
   public int selectCount(Integer userid) throws Exception{
	   int count = this.friendDAO.selectCount(userid);
	   return count;
   }
   //删除
   public int deleteFriend(Integer userid,Integer id) throws Exception{
	   int count = this.friendDAO.deleteFriend(userid, id);
	   return count;
   }
   
   //更新
   public int updateFriend(Map<String,Object>map) throws Exception{
	   int count = this.friendDAO.updateFriend(map);
	   return count;
   }
}
